<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<style type="text/css">
	*{
		margin: 0;
		padding: 0;
	}
	body,html{
		height: 320px;
	}
	body{
		position: relative;
	}
	p{
		display: block;
		margin: 0 auto;
		width: 400px;
	}
	.username{
		margin-top: 100px;
	}
	.pwd,.code{
		margin-top: 40px;
	}
	input{
		width: 320px;
		height: 30px;
		font-size:20px;
		line-height: 30px;
		text-indent: 7px;
	}
	button{
		display: block;
		margin: 0 auto;
		width: 100px;
		height: 30px;
		line-height: 30px;
		font-size: 15px;
		border: 0px;
		cursor: pointer;
		background: orange;
		font-family: '微软雅黑';
		margin-top: 30px;
	}
	.register{
		position: absolute;
		bottom: 40px;
		right: 40px;
		text-decoration: none;
		font-size: 18px;
		color: #aaa;
		font-family: '微软雅黑';
	}
	input[name=code]{
		width: 100px;
	}
</style>
</head>
<body>
	<form action="" method="post" id="login">
	<p class="username">
	<label>用户名：
	<input type="text" name="username" placeholder="手机或邮箱号码"/></label></p>
	<p class="pwd">
	<label>密　码：
	<input type="password" name="pwd"/></label></p>
	<p class="code">
	<label>验证码：
	<input type="text" name="code"/></label><a href="###"><img id="code" src="{:U('getCode')}" style="float: right;margin-top: -14px;" onclick="changeCode(this)"/></a></p>
	<button type="submit">登录</button>
	</form>
	
	<a class="register" href="{:U('register')}">注册</a>
</body>
<script type="text/javascript" src="__PUBLIC_ADMIN__lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__PUBLIC_ADMIN__lib/jquery-form.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
	function changeCode(obj){
		$(obj).attr('src',$(obj).attr('src')+'?'+Math.random());
	}
	
	$(function(){
		$('#login').ajaxForm(function(data){
			if(data.status == 1){
				var index = parent.layer.getFrameIndex(window.name);
				parent.location.reload();
				parent.layer.close(index);
			}else{
				var obj = document.getElementById('code');
				changeCode(obj);
				layer.msg(data.msg,{icon:5,time:1000});
			}
		});
	})
</script>

</html>






